package com.hspedu.poly.objpoly;

public class polyObject {
    public static void main(String[] args) {
        //体验对象多态的特点

        //animal 编译类型就是 Animal 运行类行是 Dog
        Animal animal = new Dog();
        animal.cry();

        //animal 编译类型就是 Animal 运行类行是 Cat
        animal = new Cat();
        animal.cry();
    }
}
